package org.prj;

import static org.junit.Assert.*;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

import org.junit.Test;

public class TestProxy {

	@Test
	public void test() {
	
		InvocationHandler handler = new MyInvocationHandler();
		IMyObject obj = (IMyObject) Proxy.newProxyInstance(
		                            IMyObject.class.getClassLoader(),
		                            new Class[] { IMyObject.class },
		                            handler);
		
		obj.saluta("ciao");
		
	}

}
